/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __PROJECTIONPLANE_H__
#define __PROJECTIONPLANE_H__

#include "../../Types/Types.h"
#include "../Math/Matrix4D.h"


//TODO change this to real projection plane with fov, aspectRatio etc.
class ProjectionPlane {
private:
	cFloat mVieportWidth;
	cFloat mVieportHeight;
	cFloat mWindowWidth;
	cFloat mWindowHeight;
	cFloat mClippingDistance;
	cFloat mFOV;
	cFloat mEyeDistance;

public:

    /**************************************************************
    * Constructors                                                *
    ***************************************************************/
	ProjectionPlane(): mFOV(700.0f), mClippingDistance(0.05f), mEyeDistance(40.0f) { }
    ProjectionPlane(cInt iSWidth, cInt iSHeight);
	~ProjectionPlane() { } 
        
    /**************************************************************
    * Operators                                                   *
    ***************************************************************/


    /**************************************************************
    * Other helpful  functions                                    *
    ***************************************************************/
	cBool Clip(Point4D &a, Point4D &b);
	cVoid SetViewport(cInt iSWidth, cInt iSHeight);
	cVoid ChangeFov(cFloat fFov);
	cFloat GetFOV();
	cVoid ChangeEyeDistance(cFloat fEyeDistanceDelta);
	cFloat GetEyeDistance();
	cVoid ChangeClipping(cFloat fClipping);
	cFloat GetNearClippingPlane();
};                                                                 

#endif // __PROJECTIONPLANE_H__